﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CorporateGym.DAL;

namespace BLL
{
    public class Trainee
    {
        public int TraineeId { get; set; }
        public string WorkerId { get; set; }
        public string FirstName { get; set; }
        public string LastName { get; set; }
        public string Phone { get; set; }
        public EWorkerType WorkerType { get; set; }
        public string Email { get; set; }
        public int MedicalApprovalId{ get; set; }
        public bool AbsenseNotificationSent { get; set; }
        public string FullName
        {
            get
            {
                return string.Format("{0} {1}", FirstName, LastName);
            }
        }


        internal static Trainee CreateFromRow(CorporateGymDB.TraineeRow i_Row)
        {
            return new Trainee
            {
                TraineeId = i_Row.TraineeId,
                WorkerId = i_Row.WorkerId,
                FirstName = i_Row.FirstName,
                LastName = i_Row.LastName,
                Phone = i_Row.Phone,
                WorkerType = (EWorkerType)i_Row.WorkerType,
                Email = i_Row.Email,
                MedicalApprovalId = i_Row.MedicalApprovalId,
                AbsenseNotificationSent = i_Row.AbsenseNotificationSent
            };

        }
    }
}
